import random
from typing import List, Dict
from .enemies import get_random_enemy

class Dungeon:
    def __init__(self, floor: int):
        self.floor = floor
        self.rooms: List[Dict] = []
        self.current_room = 0
        self.generate_floor()
        
    def generate_floor(self) -> None:
        """生成当前层的房间"""
        room_count = 10 + self.floor * 2
        
        # 生成所有房间
        for _ in range(room_count):
            room = {
                "type": "combat",
                "completed": False,
                "content": {
                    "enemy": get_random_enemy(self.floor)
                }
            }
            self.rooms.append(room)
            
    def generate_room_content(self, room_type: str) -> Dict:
        """根据房间类型生成内容"""
        if room_type == "combat":
            return {"enemy": get_random_enemy(self.floor)}
        elif room_type == "treasure":
            return {"loot": self.generate_treasure()}
        # 其他房间类型的内容生成...
        return {} 

    def generate_treasure(self):
        """生成宝藏内容"""
        # 这里可以根据需要返回不同类型的宝藏
        return {
            "type": "gold",
            "amount": random.randint(10, 30)  # 随机生成10-30金币
        } 